#include "BTREE.h"
/// @brief 
/// @param x 
/// @return 
BTNode* BuyNode(BTDataType x)
{
	BTNode* node = (BTNode*)malloc(sizeof(BTNode));
	if (node == NULL)
	{
		perror("malloc fail");
		return NULL;
	}

	node->data = x;
	node->left = NULL;
	node->right = NULL;

	return node;
}


void destory_tree(BTNode* root)
{
    if(root==NULL)
    {
        return ;
    }
    destory_tree(root->left);
    destory_tree(root->right);
    root=NULL;
    return ;
}